home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / checkbox-changer.izs < prev    next >
Text File  |  2005-09-28  |  4KB  |  156 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script will check all and uncheck all or use the switch to do whatever is next!<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL CHECKBOX CHANGER:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23.  
  24.  
  25.  
  26. <!-- Begin
  27. function checkAll() {
  28. for (var j = 1; j <= 14; j++) {
  29. box = eval("document.checkboxform.C" + j); 
  30. if (box.checked == false) box.checked = true;
  31.    }
  32. }
  33.  
  34. function uncheckAll() {
  35. for (var j = 1; j <= 14; j++) {
  36. box = eval("document.checkboxform.C" + j); 
  37. if (box.checked == true) box.checked = false;
  38.    }
  39. }
  40.  
  41. function switchAll() {
  42. for (var j = 1; j <= 14; j++) {
  43. box = eval("document.checkboxform.C" + j); 
  44. box.checked = !box.checked;
  45.    }
  46. }
  47. //  End -->
  48. </script>
  49. </HEAD>
  50.  
  51. <!-- STEP TWO: Add code into BODY section of document  -->
  52.  
  53. <BODY>
  54.  
  55. <center>
  56. <form name=checkboxform>
  57. <input type=checkbox name=C1 checked>C1<br>
  58. <input type=checkbox name=C2 checked>C2<br>
  59. <input type=checkbox name=C3 checked>C3<br>
  60. <input type=checkbox name=C4 checked>C4<br>
  61. <input type=checkbox name=C5 checked>C5<br>
  62. <input type=checkbox name=C6 checked>C6<br>
  63. <input type=checkbox name=C7 checked>C7<br>
  64. <input type=checkbox name=C8 checked>C8<br>
  65. <input type=checkbox name=C9 checked>C9<br>
  66. <input type=checkbox name=C10 checked>C10<br>
  67. <input type=checkbox name=C11 checked>C11<br>
  68. <input type=checkbox name=C12 checked>C12<br>
  69. <input type=checkbox name=C13 checked>C13<br>
  70. <input type=checkbox name=C14 checked>C14<br>
  71. <br>
  72. <input type=button value="Check All" onClick="checkAll()"><br>
  73. <input type=button value="Uncheck All" onClick="uncheckAll()"><br>
  74. <input type=button value="Switch All" onClick="switchAll()"><br>
  75. </form>
  76. </center>
  77.  
  78.  
  79.  
  80. <!-- END OF SCRIPT -->
  81. <!/SCRIPT>
  82.  
  83. <!PREVIEW>
  84. <!-- START OF SCRIPT -->
  85.  
  86. <!-- HOW TO INSTALL CHECKBOX CHANGER:
  87.  
  88.   1.  Copy code into the HEAD section of document
  89.   2.  Put last coding into the BODY section of document  -->
  90.  
  91. <!-- STEP ONE: Add code into HEAD section of document  -->
  92.  
  93. <HEAD>
  94.  
  95. <SCRIPT LANGUAGE="JavaScript">
  96.  
  97.  
  98.  
  99. <!-- Begin
  100. function checkAll() {
  101. for (var j = 1; j <= 14; j++) {
  102. box = eval("document.checkboxform.C" + j); 
  103. if (box.checked == false) box.checked = true;
  104.    }
  105. }
  106.  
  107. function uncheckAll() {
  108. for (var j = 1; j <= 14; j++) {
  109. box = eval("document.checkboxform.C" + j); 
  110. if (box.checked == true) box.checked = false;
  111.    }
  112. }
  113.  
  114. function switchAll() {
  115. for (var j = 1; j <= 14; j++) {
  116. box = eval("document.checkboxform.C" + j); 
  117. box.checked = !box.checked;
  118.    }
  119. }
  120. //  End -->
  121. </script>
  122. </HEAD>
  123.  
  124. <!-- STEP TWO: Add code into BODY section of document  -->
  125.  
  126. <BODY>
  127.  
  128. <center>
  129. <form name=checkboxform>
  130. <input type=checkbox name=C1 checked>C1<br>
  131. <input type=checkbox name=C2 checked>C2<br>
  132. <input type=checkbox name=C3 checked>C3<br>
  133. <input type=checkbox name=C4 checked>C4<br>
  134. <input type=checkbox name=C5 checked>C5<br>
  135. <input type=checkbox name=C6 checked>C6<br>
  136. <input type=checkbox name=C7 checked>C7<br>
  137. <input type=checkbox name=C8 checked>C8<br>
  138. <input type=checkbox name=C9 checked>C9<br>
  139. <input type=checkbox name=C10 checked>C10<br>
  140. <input type=checkbox name=C11 checked>C11<br>
  141. <input type=checkbox name=C12 checked>C12<br>
  142. <input type=checkbox name=C13 checked>C13<br>
  143. <input type=checkbox name=C14 checked>C14<br>
  144. <br>
  145. <input type=button value="Check All" onClick="checkAll()"><br>
  146. <input type=button value="Uncheck All" onClick="uncheckAll()"><br>
  147. <input type=button value="Switch All" onClick="switchAll()"><br>
  148. </form>
  149. </center>
  150.  
  151.  
  152. <!-- END OF SCRIPT -->
  153. <!/PREVIEW>
  154.  
  155. <!RELATED>NONE<!/RELATED>
  156.